Skip to content

gh-130110: Support hyphens in RFC 2231 continuation parameter names#153536

Open
Phantom-d-e-v wants to merge 2 commits into
python:mainfrom
Phantom-d-e-v:gh-130110-email-hyphen-param
Open

gh-130110: Support hyphens in RFC 2231 continuation parameter names#153536
Phantom-d-e-v wants to merge 2 commits into
python:mainfrom
Phantom-d-e-v:gh-130110-email-hyphen-param

Conversation

@Phantom-d-e-v

Copy link
Copy Markdown

Parameter names containing hyphens (e.g. file-name*0*) were not recognized as RFC 2231 continuations because the matching regular expression only allowed \w+. As a result, such parameters were left undecoded by email.utils.decode_params.

Adjust the regular expression to also accept hyphens ([\w-]+), which matches the production behaviour for non-hyphenated names.

Fixes: gh-130110

…ames

Parameter names containing hyphens (e.g. `file-name*0*`) were not
recognized as RFC 2231 continuations because the matching regular
expression only allowed `\w+`. As a result, such parameters were left
undecoded by `email.utils.decode_params`.

Adjust the regular expression to also accept hyphens (`[\w-]+`), which
matches the production behaviour for non-hyphenated names.

Fixes: pythongh-130110
@Phantom-d-e-v Phantom-d-e-v requested a review from a team as a code owner July 10, 2026 23:27
@bedevere-app

bedevere-app Bot commented Jul 10, 2026

Copy link
Copy Markdown

Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool.

If this change has little impact on Python users, wait for a maintainer to apply the skip news label instead.

@python-cla-bot

python-cla-bot Bot commented Jul 10, 2026

Copy link
Copy Markdown

All commit authors signed the Contributor License Agreement.

CLA signed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

email.utils.decode_params not supporting params that contain hyphens

1 participant